DB2中修改完表的结构,是否需要REORG操作 |
您所在的位置:网站首页 › db2 字段长度 › DB2中修改完表的结构,是否需要REORG操作 |
问题: 在DB2数据库中,修改完表的结构时,是否需要对表做一个reorg操作才能使表的状态恢复正常?
答:有以下4种操作,需要对表做reorg操作 1.) SET DATA TYPE altered-data-type 但有以下两种情况是例外,不需要reorg: 1. Increasing the length of a VARCHAR or VARGRAPHIC column 2. Decreasing the length of a VARCHAR or VARGRAPHIC column without truncating trailing blanks from existing data 2.) SET NOT NULL 3.) DROP NOT NULL 4.) DROP COLUMN 其他的操作,理论上都不需要REORG,但有些操作,是需要REORG之后才能实际生效的,比如"ALTER TABLE ... COMPRESS YES",语法上不需要REORG操作,也不会影响表的增删改查操作,但只有REORG之后,才能真正开启压缩: After a table has been altered to enable row compression, all rows in the table can be compressed immediately by performing one of the following actions: 1. REORG command 2. Online table move 3. Data unload and reload
参考资料:信息中心 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |